<template>
	<view class="content">
		<image class="icon1" mode="scaleToFill" :src="icon1"></image>
		
		<view class="wrap">
			<image class="icon2" mode="widthFix" :src="icon2"></image>
			<image class="icon3" mode="widthFix" :src="icon3"></image>
			<view class="top-txt"><text v-if="allData.worlds1">{{allData.worlds1}}</text><text v-if="allData.worlds2">{{allData.worlds2}}</text><text v-if="allData.worlds3">{{allData.worlds3}}</text><text v-if="allData.worlds4">{{allData.worlds4}}</text></view>
			<view class="top-center">
				<view v-if="allData.content1">{{allData.content1}}</view>
				<view v-if="allData.content2">{{allData.content2}}</view>
				<view v-if="allData.content3">{{allData.content3}}</view>
				<view v-if="allData.content4">{{allData.content4}}</view>
			</view>
			<view class="bottom">
				<view class="button-wrap">
					<button plain class="contact" send-message-title="下载天天充电APP" show-message-card send-message-path="/pages/index/index" open-type='contact'>
						立即下载
					</button>
				</view>
				<view class="bottom-txt"  v-if="allData.content5">{{allData.content5}}</view>
				<view class="bottom-item" v-if="allData.company">{{allData.company}}</view>
				<view class="bottom-item"><text @click="handleClick" v-if="allData.tel">{{allData.tel}}</text></view>
			</view>
		</view>
	</view>
</template>
<script>
	import {commonParams,BASE_URL} from '../../env.js';
	export default {
		data() {
			return {
				icon1:this.$imgUrl+'charge/download-01.png',
				icon2:this.$imgUrl+'charge/download-02.png',
				icon3:this.$imgUrl+'charge/download-03.png',
				allData:null,
			}
		},
		onShow() {

			uni.request({
				//测试
			    url:'https://test.api.cd1a.cn/index.php/drainage/drainage/downloadInfo',
				method:'GET',
				data:{
					userid_locked: uni.getStorageSync('userId'),
					...commonParams,
				},
			    success: ({data})=>{
					if(data.data){
						this.allData=data.data;
					}
				},
			});
		},
		methods: {
			handleClick(){
				uni.makePhoneCall({
				    phoneNumber:this.$phone
				});
			},
			// handleBtn(){
			// 	uni.navigateTo({
			// 		url:"/pages/webview/official"
			// 	})
			// }
		}
	}
</script>

<style lang="scss" scoped>
	.content{
		height:100%;
	}
	.icon1{
		width:100%;
		height:100%;
		display: block;
	}
	
	.wrap{
		position: absolute;
		left:0;
		top:0;
		width:100%;
		height:100%;
		box-sizing: border-box;
		padding-top: 80rpx;
	}
	.icon2{
		width:148rpx;
		height:148rpx;
		margin:0 auto;
		display: block;
	}
	.icon3{
		width:240rpx;
		height:78rpx;
		margin:40rpx auto;
		display: block;
		
	}
	.top-txt{
		text-align: center;
		font-size: 32rpx;
		color:#fff;
		font-weight:bold;
	}
	.top-txt text{
		padding:0 10rpx;
	}
	.top-center{
		text-align: center;
		font-size: 28rpx;
		color:#fff;
		line-height: 80rpx;
		margin:60rpx 0 60rpx 0;
	}
	.bottom-item{
		text-align: center;
		font-size: 26rpx;
		color:#fff;
		opacity:0.6;
		line-height:60rpx;
	}
	.bottom-txt{
		text-align: center;
		font-size: 28rpx;
		color:#fff;
		margin-bottom:40rpx;
		letter-spacing:6rpx;
	}
	.contact{
		border:1px solid #fff;
		color:#fff;
	}
	.button-wrap{
		width:70%;
		margin:40rpx auto;
	}
</style>
<style lang="scss">
	page{
		height:100%;
	}
</style>
